subroutine wtraj(ss,step,y)
use var
use type
use parallel
implicit none
include 'mpif.h'
integer :: step, ss, y, iout
character*20 :: string = "traj frame"

iout = 200 + ID + 1
call RANDOM_SEED(get = iseed(1:2))
if (traj(2) == 0) then
if (ID == master) then
   write(iout)string
   write(iout)frame,ss,step,y
   write(iout)ISEED    
   write(iout)trj_E
   write(iout)NP_position_back
   write(iout)q
endif
else
   write(iout)string
   write(iout)frame,ss,step,y
   write(iout)ISEED    
   write(iout)trj_E
   write(iout)NP_position
   write(iout)q
endif
frame = frame + 1
trj_E = 0.d0
end subroutine

